package sort;

public class Select {

    public static void main(String[] args) {
        int[] ints = {50,8,75,54,78,24,64,99};
        for (int i = 0; i < ints.length; i++) {
            int position = i;
            int min = ints[i];
            for (int j = i+1; j < ints.length; j++) {
                if (ints[j] < min){
                    position = j;
                    min = ints[j];
                }
            }
            ints[position] = ints[i];
            ints[i] = min;
        }

        for (int i = 0; i < ints.length; i++) {
            System.out.println(ints[i]);
        }
    }
}
